/**
 * Copyright (C) 2021 - 2031 O-Cubes Co., Ltd.
 */

/****************************************************************
 *  @file    arc.h
 *  @brief   ARC header file
 *  @version v1.0
 *  @date    30. Jan. 2024
 ****************************************************************/

#ifndef __ARC_H__
#define __ARC_H__

#include <stdint.h>
#include "io.h"
#include "bits.h"
#include "mem_map_table.h"

#ifdef __cplusplus
extern "C" {
#endif

/* ARC register base address*/
#define ARC_REG_BASE                    (MEM_MAP_MONITOR_BASE_ADDR + 0x800)

typedef struct{
	uint32_t cfg_wav_en;
	uint32_t cfg_high_b0;
	uint32_t cfg_high_b1;
	uint32_t cfg_high_b2;
	uint32_t cfg_high_b3;
	uint32_t cfg_high_b4;
	uint32_t cfg_high_b5;
	uint32_t cfg_high_b6;
	uint32_t cfg_high_b7;
	uint32_t cfg_low_b0;
	uint32_t cfg_low_b1;
	uint32_t cfg_low_b2;
	uint32_t cfg_low_b3;
	uint32_t cfg_low_b4;
	uint32_t cfg_low_b5;
	uint32_t cfg_low_b6;
	uint32_t cfg_low_b7;
	uint32_t decSouceSel;
	uint32_t arcHalfWavNum;
	uint32_t arcEnPeak;
	uint32_t arcEnAverage;
	uint32_t arcPARThr;
	uint32_t maxBit;
	uint32_t cfg_adc_mux;
	uint32_t cfg_adc;
	uint32_t ia_result[4];
	uint32_t ib_result[4];
	uint32_t ic_result[4];
	uint32_t result_ptr;	//bit0~bit6:ia_ptr; bit8~bit14:ib_ptr; bit16~bit22:ic_ptr
	uint32_t result_lock;	//bit0:lock ia_result before read; bit1:lock ib_result before read; bit0:lock ic_result before read;
}DW_ARC_REG, *DW_ARC_REG_PTR;


int32_t dw_arc_init(void);

#ifdef __cplusplus
}
#endif

#endif /* __PCL_H__ */
